From 2bae882a75af1034dbba952dd66807f30fd36e12 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Tue, 18 Feb 2014 00:17:51 +0000 Subject: [PATCH] Handle newer OSes better in reporting. Styling fixes. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4752 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/gui/aboutdlg.cc | 3 ++- gpsbabel/gui/aboutdlg.h | 2 +- gpsbabel/gui/aboutui.ui | 31 ++++++++++++++++--------------- gpsbabel/gui/mainwindow.cc | 2 +- gpsbabel/gui/upgrade.cc | 13 ++++++++----- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/gpsbabel/gui/aboutdlg.cc b/gpsbabel/gui/aboutdlg.cc index b45f015f8..a80d90077 100644 --- a/gpsbabel/gui/aboutdlg.cc +++ b/gpsbabel/gui/aboutdlg.cc @@ -25,7 +25,7 @@ #include "upgrade.h" AboutDlg::AboutDlg(QWidget *parent, const QString &ver1, - const QString &ver2): QDialog(parent) + const QString &ver2, const QString& installationId): QDialog(parent) { ui_.setupUi(this); QTextDocument *doc = ui_.textEdit->document(); @@ -34,6 +34,7 @@ AboutDlg::AboutDlg(QWidget *parent, const QString &ver1, tt.replace(QRegExp("\\$appname\\$"), QString(appName)); tt.replace(QRegExp("\\$babelversion\\$"), ver1); tt.replace(QRegExp("\\$babelfeversion\\$"), ver2); + tt.replace(QRegExp("\\$installationId\\$"), installationId); // Not localized as it should never be seen. tt.replace(QRegExp("\\$upgradetestmode\\$"), diff --git a/gpsbabel/gui/aboutdlg.h b/gpsbabel/gui/aboutdlg.h index 11d6ead4b..171ec6471 100644 --- a/gpsbabel/gui/aboutdlg.h +++ b/gpsbabel/gui/aboutdlg.h @@ -30,7 +30,7 @@ class AboutDlg: public QDialog { public: AboutDlg(QWidget *parent, const QString &ver1, - const QString &ver2); + const QString &ver2, const QString &installationId); private: Ui_AboutDlg ui_; diff --git a/gpsbabel/gui/aboutui.ui b/gpsbabel/gui/aboutui.ui index 1221851a1..099d83235 100644 --- a/gpsbabel/gui/aboutui.ui +++ b/gpsbabel/gui/aboutui.ui @@ -75,21 +75,22 @@ <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:600;">$appname$</span></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">$babelfeversion$</span></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">Copyright (C) 2009 Robert Lipe</span></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">GUI designed and contributed by S. Khai Mong</span></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">LGPL Crystal Icons by Alvarado Coehlo</span></p> -<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">(Using backend $babelversion$)</span></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">$upgradetestmode$</span></p> -<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p></body></html> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt; font-weight:600;">$appname$</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">$babelfeversion$</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">Copyright (C) 2009-2014 Robert Lipe</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">GUI designed and contributed by S. Khai Mong</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">LGPL Crystal Icons by Alvarado Coehlo</span></p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:12pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">(Using backend $babelversion$)</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">$upgradetestmode$</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">Installation ID: $installationId$</span></p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:12pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:12pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:12pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:12pt;">You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:12pt;"><br /></p></body></html> diff --git a/gpsbabel/gui/mainwindow.cc b/gpsbabel/gui/mainwindow.cc index 9e1f1e94e..fd75edd8c 100644 --- a/gpsbabel/gui/mainwindow.cc +++ b/gpsbabel/gui/mainwindow.cc @@ -1203,7 +1203,7 @@ void MainWindow::moreOptionButtonClicked() //------------------------------------------------------------------------ void MainWindow::aboutActionX() { - AboutDlg aboutDlg(0, babelVersion_, QString(appName) + QString(" " VERSION)); + AboutDlg aboutDlg(0, babelVersion_, QString(appName) + QString(" " VERSION), babelData_.installationUuid_); aboutDlg.setWindowTitle(tr("About %1").arg(appName)); aboutDlg.exec(); } diff --git a/gpsbabel/gui/upgrade.cc b/gpsbabel/gui/upgrade.cc index 8a625520b..0f0e5e310 100644 --- a/gpsbabel/gui/upgrade.cc +++ b/gpsbabel/gui/upgrade.cc @@ -105,10 +105,10 @@ QString UpgradeCheck::getOsVersion() case QSysInfo::MV_10_5: return "10.5"; break; case QSysInfo::MV_10_6: return "10.6"; break; case QSysInfo::MV_10_7: return "10.7"; break; - //case QSysInfo::MV_10_8: return "10.8"; break; - default: - if (QSysInfo::MacintoshVersion == 10) { - return "10.8"; + case QSysInfo::MV_10_8: return "10.8"; break; + default: + if (QSysInfo::MacintoshVersion == 11) { + return "10.9"; break; } return QString("Unknown Mac %1").arg(QSysInfo::MacintoshVersion); @@ -128,6 +128,8 @@ QString UpgradeCheck::getOsVersion() case QSysInfo::WV_6_0: return "Vista"; break; case QSysInfo::WV_6_1: return "7"; break; default: + if (QSysInfo::WindowsVersion == 0x00a0) return "8"; + if (QSysInfo::WindowsVersion == 0x00b0) return "8.1"; return "Windows/Unknown"; } #endif @@ -164,7 +166,7 @@ UpgradeCheck::updateStatus UpgradeCheck::checkForUpgrade( args += "¤t_gui_version=" VERSION; args += "&installation=" + babelData_.installationUuid_; args += "&os=" + getOsName(); -#if HAVE_UNAME +#if HAVE_UNAME || defined (Q_OS_MAC) struct utsname utsname; if (0 == uname(&utsname)) { args += "&cpu=" + QString(utsname.machine); @@ -338,6 +340,7 @@ void UpgradeCheck::httpRequestFinished(QNetworkReply* reply) information.setStandardButtons(QMessageBox::Yes | QMessageBox::No); information.setDefaultButton(QMessageBox::Yes); + information.setTextFormat(Qt::RichText); information.setText(response); information.setInformativeText(tr("Do you wish to download an upgrade?")); -- 2.30.2